package com.bwie.pojo;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.lang.reflect.Member;
import java.math.BigDecimal;
import java.util.Date;

import com.bwie.poi.Excel;
import lombok.Data;
import lombok.NonNull;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 红包策略表
 * @TableName tb_policy
 */
@TableName(value ="tb_policy")
@Data
public class TbPolicy implements Serializable {
    /**
     * 策略id
     */
    @TableId(type = IdType.AUTO)
    @Excel(name = "策略id")
    private Integer policyId;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @Excel(name = "创建时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;

    /**
     * 更新人
     */
    @TableField(fill = FieldFill.UPDATE)
    private String updatedBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.UPDATE)
    private Date updatedTime;

    /**
     * 策略名称
     */
    @NotBlank(message = "策略名称不能为空")
    @Excel(name = "策略名称")
    private String policyName;

    /**
     * 策略健值
     */
    @NotBlank(message = "策略健值不能为空")
    @Excel(name = "策略健值")
    private String policyCode;

    /**
     * 是否允许多次触发;0不允许1允许
     */
    @Excel(name = "是否允许多次触发",readConverterExp = "0=不允许,1=允许")
    @NotNull(message = "否允许多次触发不能为空")
    private Integer multiFlag;

    /**
     * 触发上线
     */
    @Excel(name = "触发上线")
    @NotNull(message = "触发上线不能为空")
    private Integer topLimit;

    /**
     * 红包金额
     */
    @NotNull(message = "红包金额不能为空")
    @Excel(name = "红包金额")
    private Double packetAmount;



    private Double leftAmount;


    /**
     * 生效时间
     */
    @NotNull(message = "生效时间不能为空")
    @Excel(name = "生效时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date beginTime;

    /**
     * 策略过期时间
     */
    @NotNull(message = "策略过期时间不能为空")
    @Excel(name = "策略过期时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    /**
     * 红包策略状态;0关闭1开启
     */
    @NotNull(message = "红包策略状态不能为空")
    @Excel(name = "红包策略状态",readConverterExp = "0=关闭,1=开启")
    private Integer packetEnable;

    /**
     * 触发周期
     */
    @NotNull(message = "触发周期不能为空")
    @Excel(name = "触发周期",readConverterExp = "1=周,2=天,3=月,4=总天数")
    private Integer packetPeriod;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}